home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / dpkg / info / linux-restricted-modules-common.preinst < prev    next >
Encoding:
Text File  |  2009-07-29  |  858 b   |  30 lines

  1. #!/bin/sh
  2.  
  3. set -e
  4.  
  5. # Remove a no-longer used conffile
  6. rm_conffile() {
  7.     PKGNAME="$1"
  8.     CONFFILE="$2"
  9.     if [ -e "$CONFFILE" ]; then
  10.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  11.         old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE '{s/ obsolete$//;s/.* //p}\"`"
  12.         if [ "$md5sum" != "$old_md5sum" ]; then
  13.             echo "Obsolete conffile $CONFFILE has been modified by you."
  14.             echo "Saving as $CONFFILE.dpkg-bak ..."
  15.             mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
  16.         else
  17.             echo "Removing obsolete conffile $CONFFILE ..."
  18.             rm -f "$CONFFILE"
  19.         fi
  20.     fi
  21. }
  22.  
  23. case "$1" in
  24.   install|upgrade)
  25.     rm_conffile linux-restricted-modules-common "/etc/modprobe.d/ipw3945"
  26.     rm_conffile linux-restricted-modules-common "/etc/modprobe.d/lrm-video"
  27. esac
  28.  
  29.  
  30.